The development of the EDVAC computer system of 1948 is often cited as the beginning of the computer era. Since that time, dramatic advances in both hardware (i.e., the computer's electronic components) and software (i.e., computer programs) have drastically improved the performance of computer systems. However, modern software programs, often containing millions of instructions, have become very complex when compared with early computer programs. Because the execution time (and hence, performance) of a computer program is very closely related to the number of instructions contained in the program, developers must continue to find new ways of improving the efficiency of computer software.
Most modem computer programs are typically written in a high-level language that is easy to understand by a human programmer. Special software tools, known as compilers, take the human-readable form of a computer program, known as "source code," and convert it into machine-readable instructions, known as "object code." Because a compiler generates the stream of instructions that are eventually executed on a computer system, the manner in which the compiler converts the source code into object code affects the execution time of the computer program.
As noted, the continual desire to use larger, faster and more complex software programs has forced system developers to find new methods of improving the rate at which programs run. Software developers have focused a great deal of effort on developing methods of generating efficient computer instructions that can take full advantage of the hardware systems on which they are to be executed. Such methods of improving the sequencing or placement of computer instructions within a computer program are referred to as optimizations. Numerous optimization techniques to improve the performance of software are known in the art today.
Profiling is one technique that can be used to improve software optimization. Profiling uses predicted information on how a program will run to further optimize the computer program. For example, if it is known that certain blocks of code (i.e., distinct portions of a program) will be executed more often than other code blocks, performance may be enhanced by handling those blocks of code in a particular manner. (E.g., it might be desirable to position the code blocks in memory in a manner that improves the utilization of cache memory.) Thus, profiling seeks to improve optimizations and therefore system performance by using information regarding the expected behavior of blocks of code within a computer program. Specifically, by identifying popular code blocks and execution paths, software programs can be created to maximize the performance of the hardware on which they will run.
In order to implement any profiling system, accurate profile or behavior information must be collected by first running the program on a set of inputs believed to represent typical usage of the program. This process of collecting profile information is referred to as "benchmarking." The collection of accurate profile data during the benchmarking phase is critical if profile based optimizations are to improve performance. However, a present limitation with known profiling systems includes the fact that such systems assume a model in which data-collection is active whenever the program is running. That is, as soon as the program is initiated, profiling information is continuously collected until program execution is terminated. Thus, there is no way to turn profiling on and off during program execution. Although this model is reasonable for simple, self-contained programs running benchmarks of low complexity, there are many situations where it is not desirable to collect profile data during the entire execution lifetime of a program. For example, some procedures within a program may exhibit a certain kind of behavior during initialization, and a very different behavior during the rest of the program's execution. Thus, it may be desirable to defer profile data collection until after the program has finished initialization.
This limitation is further pronounced in the case of complex software systems that are designed to run persistently, such as computer operating systems. Most computer systems utilize a continuously running operating system to provide an interface between the computer hardware and end-user. Because operating systems must fulfill a variety of tasks (e.g., booting the system, launching application programs, interfacing with hardware devices, etc.), the continuous collection of profile data may be inappropriate when attempting to examine the performance characteristics of specific tasks. Many times the performance benchmarks of interest for such a system require that the system be brought up to a "steady state" before the benchmarks can be accurately established. Thus, any benchmark data collected prior to the achievement of a steady state could pollute the targeted data being gathered.
Finally, there is no way of collecting profile data for multiple independent benchmarks on a continuously running program (such as an operating system) without having to stop and restart the program. Therefore, under known systems, the program must be re-executed each time an additional set of profile data is desired.
Thus, a need exists for a low overhead mechanism that will provide better control over the generation and collection of profile data. Without such a system, the ability to perform accurate profile based optimizations will be limited.